package demo.hw;

/**
 * todo
 *
 * @author taqo
 * @date 2021/5/25
 */
public class _句子逆序 {
    public static void main(String[] args) {
        String s = "I am a boy";
        reverse(s);
    }

    private static void reverse(String s) {
        String[] s1 = s.split(" ");
        for (int i = s1.length - 1; i >= 0; i--) {
            System.out.print(s1[i]+" ");
        }
    }
}
